//
//  LBReactPatcherModel.m
//  LBReactPatcher
//
//  Created by WuShiHai on 19/5/24.
//  Copyright (c) 2019 Lebbay All rights reserved.
//

#import "LBReactPatcherModel.h"

@implementation LBReactPatcherModel

+ (NSDictionary *)modelCustomPropertyMapper {
    return @{
        @"bundleId": @"id",
        @"type": @"patchType",
    };
}

- (BOOL)isValidate {
    return self.state == 1;
}

- (void)setValueFromSqlReuslt:(NSDictionary *)result {
    self.bundleId = [[result objectForKey:@"id"] integerValue];
    self.type = [[result objectForKey:@"type"] integerValue];
    self.appType = [[result objectForKey:@"app_type"] integerValue];
    self.bundleType = [[result objectForKey:@"bundle_type"] integerValue];
    self.appIdentifier = [result objectForKey:@"app_identifier"];
    self.appVersion = [result objectForKey:@"app_version"];
    self.mainVersion = [[result objectForKey:@"main_version"] integerValue];
    self.moduleName = [result objectForKey:@"module_name"];
    self.checkCode = [result objectForKey:@"check_code"];
    self.state = [[result objectForKey:@"state"] integerValue];
    self.url = [result objectForKey:@"url"];
}

@end
